package com.mjlf.hometeach.common.utils;

import net.sf.json.JSONObject;

import javax.servlet.http.HttpServletResponse;

/**
 * @auther a123
 * @create 2018-04-25 23:11
 * @desc 接口结果返回工具类型
 */
public final class ResponseUtil {

    public static void responseResult(String code, Object data, HttpServletResponse response){
        JSONObject result = new JSONObject();
        result.put("code", code);
        result.put("data", data);
        WebControllerResultUtil.writeResult(result, ResponseUtil.class, response);
    }
}
